Optimal. Leaf size=94 \[ -\frac {b (2 a B+A b) \sin (c+d x)}{d}+\frac {(a-b)^2 (A-B) \log (\sin (c+d x)+1)}{2 d}-\frac {(a+b)^2 (A+B) \log (1-\sin (c+d x))}{2 d}-\frac {b^2 B \sin ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2837, 801, 633, 31} \[ -\frac {b (2 a B+A b) \sin (c+d x)}{d}+\frac {(a-b)^2 (A-B) \log (\sin (c+d x)+1)}{2 d}-\frac {(a+b)^2 (A+B) \log (1-\sin (c+d x))}{2 d}-\frac {b^2 B \sin ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 633
Rule 801
Rule 2837
Rubi steps
\begin {align*} \int \sec (c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {b \operatorname {Subst}\left (\int \frac {(a+x)^2 \left (A+\frac {B x}{b}\right )}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b \operatorname {Subst}\left (\int \left (-A-\frac {2 a B}{b}-\frac {B x}{b}+\frac {b \left (a^2 A+A b^2+2 a b B\right )+\left (2 a A b+a^2 B+b^2 B\right ) x}{b \left (b^2-x^2\right )}\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {b (A b+2 a B) \sin (c+d x)}{d}-\frac {b^2 B \sin ^2(c+d x)}{2 d}+\frac {\operatorname {Subst}\left (\int \frac {b \left (a^2 A+A b^2+2 a b B\right )+\left (2 a A b+a^2 B+b^2 B\right ) x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {b (A b+2 a B) \sin (c+d x)}{d}-\frac {b^2 B \sin ^2(c+d x)}{2 d}-\frac {\left ((a-b)^2 (A-B)\right ) \operatorname {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}+\frac {\left ((a+b)^2 (A+B)\right ) \operatorname {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=-\frac {(a+b)^2 (A+B) \log (1-\sin (c+d x))}{2 d}+\frac {(a-b)^2 (A-B) \log (1+\sin (c+d x))}{2 d}-\frac {b (A b+2 a B) \sin (c+d x)}{d}-\frac {b^2 B \sin ^2(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.21, size = 81, normalized size = 0.86 \[ -\frac {2 b (2 a B+A b) \sin (c+d x)-\left ((a-b)^2 (A-B) \log (\sin (c+d x)+1)\right )+(a+b)^2 (A+B) \log (1-\sin (c+d x))+b^2 B \sin ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.48, size = 111, normalized size = 1.18 \[ \frac {B b^{2} \cos \left (d x + c\right )^{2} + {\left ({\left (A - B\right )} a^{2} - 2 \, {\left (A - B\right )} a b + {\left (A - B\right )} b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left ({\left (A + B\right )} a^{2} + 2 \, {\left (A + B\right )} a b + {\left (A + B\right )} b^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 129, normalized size = 1.37 \[ -\frac {B b^{2} \sin \left (d x + c\right )^{2} + 4 \, B a b \sin \left (d x + c\right ) + 2 \, A b^{2} \sin \left (d x + c\right ) - {\left (A a^{2} - B a^{2} - 2 \, A a b + 2 \, B a b + A b^{2} - B b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) + {\left (A a^{2} + B a^{2} + 2 \, A a b + 2 \, B a b + A b^{2} + B b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.38, size = 161, normalized size = 1.71 \[ \frac {a^{2} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {B \,a^{2} \ln \left (\cos \left (d x +c \right )\right )}{d}-\frac {2 A a b \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {2 B a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {2 B a b \sin \left (d x +c \right )}{d}+\frac {A \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {A \,b^{2} \sin \left (d x +c \right )}{d}-\frac {b^{2} B \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {B \,b^{2} \ln \left (\cos \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 109, normalized size = 1.16 \[ -\frac {B b^{2} \sin \left (d x + c\right )^{2} - {\left ({\left (A - B\right )} a^{2} - 2 \, {\left (A - B\right )} a b + {\left (A - B\right )} b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left ({\left (A + B\right )} a^{2} + 2 \, {\left (A + B\right )} a b + {\left (A + B\right )} b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) + 2 \, {\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.37, size = 80, normalized size = 0.85 \[ -\frac {\sin \left (c+d\,x\right )\,\left (A\,b^2+2\,B\,a\,b\right )+\frac {\ln \left (\sin \left (c+d\,x\right )-1\right )\,{\left (a+b\right )}^2\,\left (A+B\right )}{2}+\frac {B\,b^2\,{\sin \left (c+d\,x\right )}^2}{2}-\frac {\ln \left (\sin \left (c+d\,x\right )+1\right )\,\left (A-B\right )\,{\left (a-b\right )}^2}{2}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \sin {\left (c + d x \right )}\right ) \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sec {\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________